package com.company.clientscard.server.service;

import java.util.List;

import org.springframework.context.ApplicationContext;

import com.company.clientscard.server.domain.User;

public class UserController {
	private static ApplicationContext context;
	private static UserService service;

	public UserController() {
		context = Context.getContext();
		service = (UserService) context.getBean(UserService.class);
	}

	public void save(User object) {
		service.save(object);
	}

	public User findById(Long id) {
		return service.findById(id);
	}

	public User update(User object) {
		return service.update(object);
	}

	public List<User> findAll() {
		return service.findAll(User.class);
	}

	public List<User> findAll(int firstRow, int numberOfRows) {
		return service.findAll(User.class, firstRow, numberOfRows);
	}
}
